package app.common.dao;
import java.util.ArrayList;
import java.util.List;

import cn.lily.com.container.data.Record;
import cn.lily.com.exception.YaconException;
import cn.lily.esb.framework.drivers.db.bean.ControlDAO;
public class Leo_can_firmBean extends ControlDAO implements Cloneable {
	private static final long serialVersionUID = 1L;
	public Leo_can_firmBean() throws YaconException {
		super();
		setTableName("LEO_CAN_FIRM");
	}
	String  fcan_create_time;
	String  fcan_firm_memo;
	String  fcan_firm_nam;
	String  fcan_create_oper;
	String  fcan_firm_id;

	public void setCan_create_time( String can_create_time)throws YaconException{
		setFieldData("can_create_time",can_create_time,DATE);
		this.fcan_create_time=can_create_time;
	}

	public String getCan_create_time(){
		if ( this.fcan_create_time == null){
			return "";
		}
		else {
			return this.fcan_create_time;
		}
	}

	public void setCan_firm_memo( String can_firm_memo)throws YaconException{
		setFieldData("can_firm_memo",can_firm_memo,TEXT);
		this.fcan_firm_memo=can_firm_memo;
	}

	public String getCan_firm_memo(){
		if ( this.fcan_firm_memo == null){
			return "";
		}
		else {
			return this.fcan_firm_memo;
		}
	}

	public void setCan_firm_nam( String can_firm_nam)throws YaconException{
		setFieldData("can_firm_nam",can_firm_nam,TEXT);
		this.fcan_firm_nam=can_firm_nam;
	}

	public String getCan_firm_nam(){
		if ( this.fcan_firm_nam == null){
			return "";
		}
		else {
			return this.fcan_firm_nam;
		}
	}

	public void setCan_create_oper( String can_create_oper)throws YaconException{
		setFieldData("can_create_oper",can_create_oper,TEXT);
		this.fcan_create_oper=can_create_oper;
	}

	public String getCan_create_oper(){
		if ( this.fcan_create_oper == null){
			return "";
		}
		else {
			return this.fcan_create_oper;
		}
	}

	public void setCan_firm_id( String can_firm_id)throws YaconException{
		setFieldData("can_firm_id",can_firm_id,TEXT);
		this.fcan_firm_id=can_firm_id;
	}

	public String getCan_firm_id(){
		if ( this.fcan_firm_id == null){
			return "";
		}
		else {
			return this.fcan_firm_id;
		}
	}

	public  List<Leo_can_firmBean> findListBeans(String sSqlWhere)throws YaconException {
		List<Leo_can_firmBean> listBeans = new ArrayList<Leo_can_firmBean>();
		findTable = findTableByWhere(sSqlWhere);
		while (findTable.next())
		{
			Leo_can_firmBean fDaoBean  = new Leo_can_firmBean();
			fDaoBean.fcan_create_time = findTable.getString("can_create_time");
			fDaoBean.fcan_firm_memo = findTable.getString("can_firm_memo");
			fDaoBean.fcan_firm_nam = findTable.getString("can_firm_nam");
			fDaoBean.fcan_create_oper = findTable.getString("can_create_oper");
			fDaoBean.fcan_firm_id = findTable.getString("can_firm_id");
			fDaoBean.operate_mode = "edit";
			listBeans.add(fDaoBean);
		}
		return listBeans;
	}

	public Leo_can_firmBean findBean(String sSqlWhere)throws YaconException {
		findTable = findTableByWhere(sSqlWhere);
		if (findTable.next())
		{
			Leo_can_firmBean fDaoBean  = new Leo_can_firmBean();
			fDaoBean.fcan_create_time = findTable.getString("can_create_time");
			fDaoBean.fcan_firm_memo = findTable.getString("can_firm_memo");
			fDaoBean.fcan_firm_nam = findTable.getString("can_firm_nam");
			fDaoBean.fcan_create_oper = findTable.getString("can_create_oper");
			fDaoBean.fcan_firm_id = findTable.getString("can_firm_id");
			fDaoBean.operate_mode = "edit";
			return fDaoBean;
		}else
			return null;
	}

	public void setViewRecord(Record viewRecord) throws YaconException{
		if (viewRecord.getString("can_create_time") != null)
			setCan_create_time(viewRecord.getString("can_create_time"));
		if (viewRecord.getString("can_firm_memo") != null)
			setCan_firm_memo(viewRecord.getString("can_firm_memo"));
		if (viewRecord.getString("can_firm_nam") != null)
			setCan_firm_nam(viewRecord.getString("can_firm_nam"));
		if (viewRecord.getString("can_create_oper") != null)
			setCan_create_oper(viewRecord.getString("can_create_oper"));
		if (viewRecord.getString("can_firm_id") != null)
			setCan_firm_id(viewRecord.getString("can_firm_id"));
	}

}
